package ibm.cognos.imt;

import com.cognos.developer.schemas.bibus._3.ReportService_PortType;
import com.cognos.developer.schemas.bibus._3.ReportService_ServiceLocator;

import java.net.URL;

/**
 * Created with IntelliJ IDEA.
 * User: eric
 * Date: 3/19/14
 * Time: 1:40 PM
 * To change this template use File | Settings | File Templates.
 */
public class ReportServiceUtil {

    private static ReportService_PortType reportService = null;

    private static ReportService_PortType getReportService() throws Exception {
        if (reportService == null) {
            connectToReportServer();
        }
        return reportService;
    }

    public static void connectToReportServer() throws Exception {
        ReportService_ServiceLocator reportServiceLocator = new ReportService_ServiceLocator();
        System.out.println("connect to server "+ BiServerConfig.dispatcherURI());
        reportService = reportServiceLocator.getreportService(new URL(BiServerConfig.dispatcherURI()));
    }


}
